Skip to content

debug.gemを活用して間違っている部分のプログラムを修正#1

Open
1mori wants to merge 3 commits intomainfrom
my-debug
Open

debug.gemを活用して間違っている部分のプログラムを修正#1
1mori wants to merge 3 commits intomainfrom
my-debug

Conversation

@1mori
Copy link
Copy Markdown
Owner

@1mori 1mori commented May 10, 2024

No description provided.

Comment thread cafe.rb Outdated
@@ -1,4 +1,5 @@
# frozen_string_literal: true
require "debug"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

デバッグ用の記述なので提出物からは削りましょう

Comment thread cafe.rb Outdated
order2 = take_order(FOODS)

total = FOODS[order1][:price] + DRINKS[order2][:price]
total = DRINKS[order1][:price].to_i + FOODS[order2][:price].to_i
Copy link
Copy Markdown

@maedana maedana May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以下対応は任意で結構です。

これでよいのですが、そもそもでいうとorder1order2というわかりにくい変数名が引き起こしがちな不具合です。したがってよりよい対応としては変数名の見直しまでやると尚よいです。ご参考までに

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants